package com.gist.cithub.evaluate.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gist.common.utils.PageUtils;
import com.gist.common.utils.Query;

import com.gist.cithub.evaluate.dao.SumInforDao;
import com.gist.cithub.evaluate.entity.SumInforEntity;
import com.gist.cithub.evaluate.service.SumInforService;


@Service("sumInforService")
public class SumInforServiceImpl extends ServiceImpl<SumInforDao, SumInforEntity> implements SumInforService {
    @Autowired
    SumInforDao sumInforDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SumInforEntity> page = this.page(
                new Query<SumInforEntity>().getPage(params),
                new QueryWrapper<SumInforEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SumInforEntity> getSuminforBySId(Integer sid) {
        QueryWrapper<SumInforEntity> queryWrapper=new QueryWrapper<>();
        queryWrapper.and(
                wrapper ->
                        wrapper.eq("service_id",sid)
        );
        List<SumInforEntity> sumInforEntityList=sumInforDao.selectList(queryWrapper);
        return sumInforEntityList;
    }

}